/*
 * Copyright (c) 2025, 廖树财, <study_2030@163.com>
 *
 * PHS2.0-OTA is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2     
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
#pragma once

#include <stdlib.h>
#include <string.h>
#include "zlog.h"
#include "common.h"
#include "sqlite3.h"
#include "define.h"


bool SqlINSERTIntoDirectoryMonitoring(char* param);

bool SqlDeleteDirectoryMonitoring();

bool SqlSearchpara(char* remsg);

int SqlINSERTIntoNetworkPolicy(PIOTA_NETWORKLIST_PARAM_V1 param);

int SqlDeleteNetworkPolicy(char* id);

int SqlSearNetworkPolicyById(char* id, PIOTA_NETWORKLIST_PARAM_V1 param);

int SqlSearNetworkPolicy(PIOTA_NETWORKLIST_PARAM_V1 param);

int SqlSearNetworkPolicyCOUNT();

int SqlSearNetworkPolicyCOUNT_V1(PIOTA_NETWORKLIST_PARAM_V1 param);

bool SqlSearNetworkPolicyByAll(PIOTA_NETWORKLIST_PARAM_V1 input);

bool SqlSearNetworkPolicyWithOutPort(PIOTA_NETWORKLIST_PARAM_V1 input);

int SqlSearNetworkTrafficCOUNT();

int SqlSearNetworkTraffic(PNetInterface param);

int SqlINSERTIntoNetworkTraffic(PNetInterface param,int count);

int SqlINSERTIntoPasswordPolicy(password_policy_t param);

int SqlQueryPasswordPolicy(password_policy_t* param);

bool SqlDeletePasswordPolicy();

int SqlSearNetworkPolicyCOUNT_V2(PIOTA_NETWORKLIST_PARAM_V2 param);

int SqlSearNetworkPolicy_V2(PIOTA_NETWORKLIST_PARAM_V2 param);

int SqlINSERTIntoNetworkFirewall(RuleCollection* db_input_rules);

int SqlINSERTIntoNetworkFirewallOne(IOTA_NETWORKLIST_PARAM_V2* db_input_rules);

int SqlDeleteNetworkFirewallById(char* id);

int SqlSearNetworkFirewallByid(PIOTA_NETWORKLIST_PARAM_V2 param, char* id);

int SqlVLCFGPUSHLOGCOUNT();

int SqlVLCFGPUSHLOGCOUNTBYALL(PIOTA_NETWORKLIST_PARAM_V2 param);

int SqlVLCFGPUSHLOGCOUNTBYMID(char* mid);

int SqlINSERTIntoVLCFGPUSHLOG(char* mid, char* date, int code, char* data);

int SqlDeleteVLCFGPUSHLOG();